<%@page import="entity.Question"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="java.util.Locale"%>
<% 
	request.setCharacterEncoding("utf-8");
	response.setHeader("Content-Type","text/html; charset=utf-8");
	response.setHeader("Vary","Accept-Encoding");
	response.setCharacterEncoding("utf-8");
%>
<% 
	HttpSession ss = request.getSession(true);
	ResourceBundle resource = (ResourceBundle) ss.getAttribute("language");
	int currentPage = Integer.valueOf(request.getAttribute("currentPage").toString());
	
%>
<%
	String language = resource.getString("code");
	String title = (String) request.getAttribute("title");
	String description = (String) request.getAttribute("description");
	String keywords = (String) request.getAttribute("keyword");
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>	
</jsp:include><div class="bd">
			<div class="bl">
				<jsp:include page="element/adv3.jsp"></jsp:include>
				<br/><br/><br/>
				<h2><%= resource.getString("lastest") %></h2>
				<div class="adt">
					<!-- AddThis Button BEGIN -->
					<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
					<a class="addthis_button_preferred_1"></a>
					<a class="addthis_button_preferred_2"></a>
					<a class="addthis_button_preferred_3"></a>
					<a class="addthis_button_preferred_4"></a>
					<a class="addthis_button_compact"></a>
					<a class="addthis_counter addthis_bubble_style"></a>
					</div>
					<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
					<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4d6f3cdb1d190d60"></script>
					<!-- AddThis Button END -->
				</div>
				<div class="adt so">
					<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
					<g:plusone size="standard" count="true"></g:plusone>
				</div>
				<div class="clear"></div>
				<ul class="lq">
				<%
					List<Question> listQuestion = (List<Question>)request.getAttribute("listQuestion"); 
					if(listQuestion.size()>0){
						for(Question item: listQuestion)
						{								
				%>
							<li>
								<h1>
									<a href="<%=request.getContextPath()%>/<%=resource.getString("code")%>/question/<%=item.getAlias() %>" title="<%= item.getTitle()%>"><%=item.getTitle() %></a>
								</h1>
								<p>
									<%= item.getSubContent() %>
								</p> <%
									for(String tag: item.getTags()){
										%> 
											<%
												if(tag!=null){
													%>
														<a href="<%=request.getContextPath()%>/<%=resource.getString("code")%>/tag/<%=tag%>"><%=tag%></a>											
													<%
												}
											%>								
										<% 
									}
								%>  								
							</li>
				<% 								
						}
					}
				%>				
			</ul>
			</div>
			<div class="br">
				<jsp:include page="element/top_right.jsp"></jsp:include>
				<jsp:include page="element/tag.jsp">
					<jsp:param name="language" value="<%=language %>"/>
				</jsp:include>
				<jsp:include page="element/recent_view.jsp">
					<jsp:param name="language" value="<%=language %>"/>
				</jsp:include>
				<jsp:include page="element/random.jsp">
					<jsp:param name="language" value="<%=language %>"/>
				</jsp:include>
				<jsp:include page="element/new.jsp">
					<jsp:param name="language" value="<%=language %>"/>
				</jsp:include>
			</div>
			<div class="clear"></div>
		</div>
<jsp:include page="/layout/footer.jsp">
	<jsp:param name="language" value="<%=language %>"/>
</jsp:include>			